<template>
  <div id="cart">
    <nav-bar class="nav-bar"><div slot="center">购物车({{cartlength}})</div></nav-bar>
    <cart-lsit :cartList='cartList'></cart-lsit>
    <car-bottom-bar></car-bottom-bar>
  </div>
</template>

<script>
  import NavBar from 'components/common/navbar/NavBar'
  import CartLsit from './childComps/CartList'
  import CarBottomBar from './childComps/CarBottomBar.vue'

  import { mapGetters } from 'vuex'


	export default {
		name: "Cart",
    components: {
      NavBar,
      CartLsit,
      CarBottomBar
    },
    computed: {
       ...mapGetters(['cartlength','cartList'])
      // ...mapGetters({
      //   length: 'cartlength'
      // })
    }
	}
</script>

<style scoped>
  #cart {
    /*position: relative;*/
    height: 100vh;
  }

  .nav-bar {
    background-color: var(--color-tint);
    font-weight: 700;
    color: #fff;
  }
 
</style>
